<meta charset="utf-8"/>
<?php
include("../connectDB.php");
		
		$masv 			= $_POST["txt_masv"];
		$hoten 			= $_POST["txt_hoten"];
		$ngaysinh 		= $_POST["txt_ngaysinh"];
		$gioitinh 		= $_POST["gender"];
		$quequan 		= $_POST["txt_quequan"];
		$dantoc 		= $_POST["dantoc"];
		$lop 			= $_POST["txt_lop"];
		$khoa 			= $_POST["txt_khoa"];
		$nienkhoa 		= $_POST["txt_nienkhoa"];
		$socm 			= $_POST["txt_socm"];
		$sodt 			= $_POST["txt_dienthoai"];
		$anh 			= $_FILES['img']['name'];
		
	$sql = "INSERT INTO sinhvien VALUES('$masv','$hoten','$ngaysinh','$gioitinh','$quequan','$dantoc','$lop','$khoa','$nienkhoa','$socm','$sodt','$anh')";
				
	if(mysql_query($sql))
	{

		
?>
		<script language = "javascript">
		alert("ban da them moi sinh vien thanh cong");
		self.location = "../?mod=sinhvien&do=dssv";
		</script>
		<?php
			}
			else
			{
		?>
		<script language = "javascript">
		alert("ban da them moi sinh vien khong thanh cong");
		self.location = "../?mod=sinhvien&do=add";
		</script>
		<?php		
	}
	move_uploaded_file($_FILES['img']['tmp_name'],'images/'.$anh);
?>
